package com.yunkaweilai.android.fragment;

import android.content.Intent;
import android.graphics.Color;
import android.os.Bundle;
import android.support.annotation.Nullable;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.RelativeLayout;
import android.widget.TextView;

import com.classic.common.MultipleStatusView;
import com.github.lazylibrary.util.StringUtils;
import com.google.gson.Gson;
import com.umeng.analytics.MobclickAgent;
import com.yunkaweilai.android.R;
import com.yunkaweilai.android.activity.operation.consumption.quick.CalculatorActivity;
import com.yunkaweilai.android.activity.operation.consumption.shops.ShopConsumptionActivity;
import com.yunkaweilai.android.activity.web.WebActivity;
import com.yunkaweilai.android.base.BaseApplication;
import com.yunkaweilai.android.base.BaseFragment;
import com.yunkaweilai.android.constants.Api;
import com.yunkaweilai.android.constants.Umeng;
import com.yunkaweilai.android.model.AppRuleModel;
import com.yunkaweilai.android.model.HomeTimeModel;
import com.yunkaweilai.android.model.PayTypeModel;
import com.yunkaweilai.android.model.StoreInfoModel;
import com.yunkaweilai.android.model.home.AppHomeModel;
import com.yunkaweilai.android.model.home.HomeGridModel;
import com.yunkaweilai.android.net.HttpRequest;
import com.yunkaweilai.android.net.PostProcess;
import com.yunkaweilai.android.utils.Utils;
import com.yunkaweilai.android.view.dialog.NoTimeDialog;
import com.yunkaweilai.android.view.home.HeaderChannelView1;
import com.yunkaweilai.android.view.home.HeaderDividerView;
import com.yunkaweilai.android.view.home.SmoothListView;
import com.zhy.adapter.abslistview.CommonAdapter;
import com.zhy.adapter.abslistview.ViewHolder;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import butterknife.BindView;
import butterknife.ButterKnife;
import cn.bingoogolapple.refreshlayout.BGARefreshLayout;

import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName1;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName10;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName11;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName12;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName13;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName14;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName15;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName16;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName2;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName3;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName4;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName5;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName6;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName7;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName8;
import static com.yunkaweilai.android.constants.GridViewConstants.GridlistName9;

/**
 * 操作界面
 * Created by Administrator on 2017-02-24.
 */

public class OperationFragment extends BaseFragment implements BGARefreshLayout.BGARefreshLayoutDelegate {

    @BindView(R.id.id_smoothListView)
    SmoothListView idSmoothListView;
    @BindView(R.id.content_view)
    BGARefreshLayout contentView;
    @BindView(R.id.id_multipleStatusView)
    MultipleStatusView idMultiplestatusview;
    @BindView(R.id.operation_relative_quick)
    RelativeLayout mRelativeLayoutQuick;
    @BindView(R.id.operation_imgv_quick)
    ImageView mImageViewQuick;
    @BindView(R.id.operation_relative_product)
    RelativeLayout mRelativeLayoutProduct;
    @BindView(R.id.operation_imgv_product)
    ImageView mImageViewProduct;
    @BindView(R.id.operation_text_title)
    TextView mTextViewTitle;
    @BindView(R.id.operation_tv_quick)
    TextView mTextViewquick;
    @BindView(R.id.operation_tv_product)
    TextView mTextViewProduct;
    private AppHomeModel appHomeModel;
    //        private HeaderBannerView headerBannerView;
//    private HeaderShopInfoView headerShopInfoView; // 统计头列表
    private HeaderChannelView1 headerChannelView;
    private HeaderDividerView headerDividerView;

    private boolean isfirst = true;
    private boolean first = true;
    private CommonAdapter<AppHomeModel.DataBean.LastOrderBean> adapter;
    private ArrayList<AppHomeModel.DataBean.LastOrderBean> list = new ArrayList<>();
    private ArrayList<HomeGridModel> gridList = new ArrayList<>();
    private AppRuleModel.DataBean.InfoBean appRuleModel;
    private Map<String, Boolean> app_rule = new HashMap<>();
    Gson gson = new Gson();
    public String StoreName = "";

    public void inStoreName(String StoreName) {
        this.StoreName = StoreName;
    }

    public void refresh() {
//        idMultiplestatusview.showLoading();
//        initHttp();
        mTextViewTitle.setText(StoreName);
    }

    public static OperationFragment newInstance(String storename) {

        Bundle args = new Bundle();
        args.putString("storename", storename);
        OperationFragment fragment = new OperationFragment();
        fragment.setArguments(args);
        return fragment;
    }

    @Override
    public int getContentViewId() {
        return R.layout.fragment_operation;
    }

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        // TODO: inflate a fragment view
        View rootView = super.onCreateView(inflater, container, savedInstanceState);
        ButterKnife.bind(this, rootView);
        initRefreshLayout(contentView, this, false);
        return rootView;
    }

    @Override
    public void onActivityCreated(@Nullable Bundle savedInstanceState) {
        super.onActivityCreated(savedInstanceState);
        idMultiplestatusview.showLoading();
//        idMultiplestatusview.setOnRetryClickListener(new View.OnClickListener() {
//            @Override
//            public void onClick(View v) {
//                idMultiplestatusview.showLoading();
//                initHttp();
//            }
//        });
        appRuleModel = BaseApplication.getAppRuleModel();
        if (appRuleModel != null) {
            app_rule = appRuleModel.getApp_rule();
            if (appRuleModel.isIs_super()) {
                MobclickAgent.onEvent(mAc, Umeng.SUPER);
            } else {
                MobclickAgent.onEvent(mAc, Umeng.STAFF);
            }
        }

        initView();
        initAdapter();
        getPayType();
        if (isfirst) {
            addView();
        }
        initGetTime();
    }


    private void initGetTime() {
        HttpRequest.postUrl(Api.TIME_TIXING)
                .execute(new PostProcess.StringCallBack() {
                    @Override
                    public void onResponse(String json) {
                        boolean checkCode = Utils.checkCode(mAc, json);
                        if (checkCode) {
                            HomeTimeModel homeTimeModel = gson.fromJson(json, HomeTimeModel.class);
                            if (homeTimeModel.getData().getInfo().isIs_deadline_remind()) {
                                NoTimeDialog dialog = new NoTimeDialog(mAc, homeTimeModel.getData().getInfo().getDeadline_remind_str());
                                dialog.setCanceledOnTouchOutside(false);
                                dialog.show();
                            }
                        }
                    }

                    @Override
                    public void onError(Exception e) {

                    }
                });
    }


    //获取店铺的充值方式
    private void getPayType() {
        HttpRequest.postUrl(Api.PEY_TYPE_ALL)
                .execute(new PostProcess.StringCallBack() {
                    @Override
                    public void onResponse(String json) {
                        boolean checkCode = Utils.checkCode(mAc, json);
                        if (checkCode) {
                            PayTypeModel payTypeModel = gson.fromJson(json, PayTypeModel.class);
                            BaseApplication.payModel = payTypeModel;
                        }
                    }

                    @Override
                    public void onError(Exception e) {

                    }
                });
    }

    //已弃用
    private void initAdapter() {
        adapter = new CommonAdapter<AppHomeModel.DataBean.LastOrderBean>(mAc, R.layout.item_list_operation_home, list) {
            @Override
            protected void convert(final ViewHolder viewHolder, final AppHomeModel.DataBean.LastOrderBean item, int position) {

                viewHolder.setText(R.id.id_tv_order_no, item.getType() + "：" + item.getTid());
                if (StringUtils.isEmpty(item.getLevel_name())) {
                    viewHolder.setText(R.id.id_tv_name, "散客");
                } else {
                    viewHolder.setText(R.id.id_tv_name, item.getMember_name() + " (" + item.getLevel_name() + ")");
                }
                viewHolder.setText(R.id.id_tv_time, item.getCreate_time() + "");
                viewHolder.setText(R.id.id_tv_price, item.getS_payment() + "");

                LinearLayout idLlayoutItem = viewHolder.getView(R.id.id_llayout_item);
                idLlayoutItem.setOnClickListener(new View.OnClickListener() {
                    @Override
                    public void onClick(View v) {
                        if (!item.getOrder_type()) {
                            WebActivity.actionStart(mAc, Api.BASE_URL + "index.php/app/OrderInfoView.html?tid=" + item.getTid() +
                                    "&token=" + BaseApplication.getToken());
                        } else {
                            WebActivity.actionStart(mAc, Api.BASE_URL + "index.php/app/RechargeInfoView.html?tid=" + item.getTid()
                                    + "&token=" + BaseApplication.getToken());
                        }
                    }
                });

            }
        };

    }


    private void initView() {
//        headerBannerView = new HeaderBannerView(mAc);
//        headerShopInfoView = new HeaderShopInfoView(mAc);
        headerChannelView = new HeaderChannelView1(mAc);
        if (getArguments() != null) {
            StoreName = getArguments().getString("storename");
            mTextViewTitle.setText(StoreName);
        }
        refreshGridList();
//        headerDividerView = new HeaderDividerView(mAc);
        headerChannelView.fillView(gridList, idSmoothListView);

    }

    private void refreshGridList() {
        gridList.clear();

        mRelativeLayoutQuick.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (appRuleModel.isIs_super() || appRuleModel.getApp_rule().get("4")) {
                    MobclickAgent.onEvent(mAc, Umeng.QUICK_CONSUME);
                    mAc.startActivity(new Intent(mAc, CalculatorActivity.class));
                    MobclickAgent.onEvent(mAc, "abc");
                }
            }
        });
        mRelativeLayoutProduct.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                if (appRuleModel.isIs_super() || appRuleModel.getApp_rule().get("4")) {
                    MobclickAgent.onEvent(mAc, Umeng.SHOP_CONSUME);
                    BaseApplication.cleanSelectedMaps();
                    mAc.startActivity(new Intent(mAc, ShopConsumptionActivity.class));
                }
            }
        });
        if (appRuleModel != null && appRuleModel.getApp_rule().get("4")) {
            mImageViewQuick.setImageResource(R.mipmap.ic_home_quick);
            mImageViewProduct.setImageResource(R.mipmap.ic_home_product);
            mTextViewquick.setTextColor(Color.WHITE);
            mTextViewProduct.setTextColor(Color.WHITE);

        } else {
            mImageViewQuick.setImageResource(R.mipmap.ic_home_quick_hui);
            mImageViewProduct.setImageResource(R.mipmap.ic_home_product_hui);
            mTextViewquick.setTextColor(mAc.getResources().getColor(R.color.wjx_content_txt_grey));
            mTextViewProduct.setTextColor(mAc.getResources().getColor(R.color.wjx_content_txt_grey));
        }

        if (appRuleModel != null && appRuleModel.isIs_super()) {
            gridList.add(new HomeGridModel(R.mipmap.ic_home_num_consumption, GridlistName1, R.color.wjx_content_txt_black_left));
            gridList.add(new HomeGridModel(R.mipmap.ic_home_room_consumption, GridlistName2, R.color.wjx_content_txt_black_left));
            gridList.add(new HomeGridModel(R.mipmap.ic_home_guadan_list, GridlistName3, R.color.wjx_content_txt_black_left));

            gridList.add(new HomeGridModel(R.mipmap.ic_home_member_guanli, GridlistName4, R.color.wjx_content_txt_black_left));
            gridList.add(new HomeGridModel(R.mipmap.ic_hone_member_add_new, GridlistName5, R.color.wjx_content_txt_black_left));
            gridList.add(new HomeGridModel(R.mipmap.ic_home_member_lv_new, GridlistName6, R.color.wjx_content_txt_black_left));

            gridList.add(new HomeGridModel(R.mipmap.ic_home_shop_consumption, GridlistName7, R.color.wjx_content_txt_black_left));
            gridList.add(new HomeGridModel(R.mipmap.ic_home_add_product, GridlistName8, R.color.wjx_content_txt_black_left));
            gridList.add(new HomeGridModel(R.mipmap.ic_home_add_jici, GridlistName9, R.color.wjx_content_txt_black_left));

            gridList.add(new HomeGridModel(R.mipmap.ic_home_recharge, GridlistName10, R.color.wjx_content_txt_black_left));
            gridList.add(new HomeGridModel(R.mipmap.ic_home_jici_recharge, GridlistName11, R.color.wjx_content_txt_black_left));
            gridList.add(new HomeGridModel(R.mipmap.ic_home_score_charge, GridlistName12, R.color.wjx_content_txt_black_left));

            gridList.add(new HomeGridModel(R.mipmap.ic_home_points, GridlistName13, R.color.wjx_content_txt_black_left));
            gridList.add(new HomeGridModel(R.mipmap.ic_home_message, GridlistName14, R.color.wjx_content_txt_black_left));//todo:k1 华为上架更改
            gridList.add(new HomeGridModel(R.mipmap.wechat_member_center, GridlistName15, R.color.wjx_content_txt_black_left));

            gridList.add(new HomeGridModel(R.mipmap.ic_home_lock, GridlistName16, R.color.wjx_content_txt_black_left));

//            gridList.add(new HomeGridModel(R.mipmap.ic_home_mail,"站内提醒",R.color.wjx_content_txt_black_left));
        } else {
            if (app_rule.get("8") != null && app_rule.get("8")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_home_num_consumption, GridlistName1, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_num_consumption_hui, GridlistName1, R.color.wjx_content_txt_grey));
            }
            if (app_rule.get("7") != null && app_rule.get("7")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_home_room_consumption, GridlistName2, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_room_consumption_hui, GridlistName2, R.color.wjx_content_txt_grey));
            }
            if (app_rule.get("11") != null && app_rule.get("11")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_home_guadan_list, GridlistName3, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_guadan_list_hui, GridlistName3, R.color.wjx_content_txt_grey));
            }


            if (app_rule.get("17") != null && app_rule.get("17")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_home_member_guanli, GridlistName4, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_member_guanli_hui, GridlistName4, R.color.wjx_content_txt_grey));
            }
            if (app_rule.get("18") != null && app_rule.get("18")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_hone_member_add_new, GridlistName5, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_hone_member_add_new_hui, GridlistName5, R.color.wjx_content_txt_grey));
            }
            if (app_rule.get("15") != null && app_rule.get("15")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_home_member_lv_new, GridlistName6, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_member_lv_new_hui, GridlistName6, R.color.wjx_content_txt_grey));
            }


            if (app_rule.get("20") != null && app_rule.get("20")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_home_shop_consumption, GridlistName7, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_shop_consumption_hui, GridlistName7, R.color.wjx_content_txt_grey));
            }
            if (app_rule.get("21") != null && app_rule.get("21")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_home_add_product, GridlistName8, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_add_product_hui, GridlistName8, R.color.wjx_content_txt_grey));
            }
            if (app_rule.get("22") != null && app_rule.get("22")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_home_add_jici, GridlistName9, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_add_jici_hui, GridlistName9, R.color.wjx_content_txt_grey));
            }


            if (app_rule.get("9") != null && app_rule.get("9")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_home_recharge, GridlistName10, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_recharge_hui, GridlistName10, R.color.wjx_content_txt_grey));
            }
            if (app_rule.get("10") != null && app_rule.get("10")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_home_jici_recharge, GridlistName11, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_jici_recharge_hui, GridlistName11, R.color.wjx_content_txt_grey));
            }
            if (app_rule.get("12") != null && app_rule.get("12")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_home_score_charge, GridlistName12, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_score_charge_hui, GridlistName12, R.color.wjx_content_txt_grey));
            }

            if (app_rule.get("25") != null && app_rule.get("25")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_home_points, GridlistName13, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_points_hui, GridlistName13, R.color.wjx_content_txt_grey));
            }
            if (app_rule.get("26") != null && app_rule.get("26")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_home_message, GridlistName14, R.color.wjx_content_txt_black_left));//todo:k1 华为上架更改
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_message_hui, GridlistName14, R.color.wjx_content_txt_grey));
            }
            if (app_rule.get("27") != null && app_rule.get("27")) {
                gridList.add(new HomeGridModel(R.mipmap.wechat_member_center, GridlistName15, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.wechat_member_center_hui, GridlistName15, R.color.wjx_content_txt_grey));
            }
            if (app_rule.get("28") != null && app_rule.get("28")) {
                gridList.add(new HomeGridModel(R.mipmap.ic_home_lock, GridlistName16, R.color.wjx_content_txt_black_left));
            } else {
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_lock_hui, GridlistName16, R.color.wjx_content_txt_grey));
            }

            //
//            if (app_rule.get("16")){
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_mail,"站内提醒",R.color.wjx_content_txt_black_left));
//            }else{
//                gridList.add(new HomeGridModel(R.mipmap.ic_home_mail_hui,"站内提醒",R.color.wjx_content_txt_grey));
//            }
        }
    }

    private void initHttp() {
        HttpRequest.postUrl(Api.OPERATION_APP_HOME)
                .execute(new PostProcess.StringCallBack() {
                    @Override
                    public void onResponse(String json) {

                        boolean checkCode = Utils.checkCode(mAc, json);
                        if (checkCode) {
                            Gson gson = new Gson();
                            appHomeModel = gson.fromJson(json, AppHomeModel.class);
                            list.clear();
//                            list.addAll(appHomeModel.getData().getLast_order());
                            if (isfirst) {
                                addView();
                            } else {
//                                refreshView();
                            }
                            if (idMultiplestatusview != null) {
                                idMultiplestatusview.showContent();
                            }
                        } else {
                            if (idMultiplestatusview != null) {
                                idMultiplestatusview.showError();
                            }
                        }
                    }

                    @Override
                    public void onError(Exception e) {
                        if (idMultiplestatusview != null) {
                            idMultiplestatusview.showError();
                        }
                    }
                });
    }

    //刷新布局  //注释的是刷新旧版的轮播图和消费信息
    private void refreshView() {
//        headerBannerView.refreshView(appHomeModel.getData().getLoop_pic());
//        headerShopInfoView.refresh(appHomeModel.getData().getToday_data());
        appRuleModel = BaseApplication.getAppRuleModel();
        if (appRuleModel != null) {
            app_rule = appRuleModel.getApp_rule();
        }
        refreshGridList();
        headerChannelView.refreshView(gridList);
    }

    //添加布局
    private void addView() {
//        headerBannerView.fillView(appHomeModel.getData().getLoop_pic(),idSmoothListView);
//        headerShopInfoView.fillView(appHomeModel.getData().getToday_data(),idSmoothListView);
//        headerChannelView.fillView(gridList, idSmoothListView);
//        headerDividerView.fillView("",idSmoothListView);
        idSmoothListView.setAdapter(adapter);
        adapter.notifyDataSetChanged();
        isfirst = false;
        if (contentView != null) {
            contentView.endRefreshing();
        }
        if (idMultiplestatusview != null) {
            idMultiplestatusview.showContent();
        }
//        headerBannerView.enqueueBannerLoopMessage();
    }

    @Override
    public void onResume() {
        super.onResume();
//        headerBannerView.enqueueBannerLoopMessage();
    }

    @Override
    public void onStop() {
        super.onStop();
//        headerBannerView.removeBannerLoopMessage();
    }

    @Override
    public void onDestroyView() {
        super.onDestroyView();
    }

    //下拉刷新
    @Override
    public void onBGARefreshLayoutBeginRefreshing(BGARefreshLayout refreshLayout) {
//        initHttp();
        if (contentView != null) {
            contentView.beginRefreshing();
        }
        //重新刷新权限
        HttpRequest.postUrl(Api.APP_RULE)
                .execute(new PostProcess.StringCallBack() {
                    @Override
                    public void onResponse(String json) {
                        boolean checkCode = Utils.checkCode(mAc, json);
                        if (checkCode) {
                            Gson gson = new Gson();
                            AppRuleModel appRuleModel = gson.fromJson(json, AppRuleModel.class);
                            BaseApplication.appRuleModel = appRuleModel.getData().getInfo();

                            refreshView();

                        }
                        if (contentView != null) {
                            contentView.endRefreshing();
                        }
                    }

                    @Override
                    public void onError(Exception e) {
                        if (contentView != null) {
                            contentView.endRefreshing();
//                            refreshView();
                        }
                    }
                });
        HttpRequest.postUrl(Api.STORE_INFO)
                .execute(new PostProcess.StringCallBack() {
                    @Override
                    public void onResponse(String json) {
                        Gson gson = new Gson();
                        boolean checkCode = Utils.checkCode(mAc, json);
                        if (checkCode) {
                            StoreInfoModel storeInfoModel = gson.fromJson(json, StoreInfoModel.class);
                            mTextViewTitle.setText(storeInfoModel.getData().getInfo().getStore_name());
                        }
                    }

                    @Override
                    public void onError(Exception e) {
                    }
                });
    }

    @Override
    public boolean onBGARefreshLayoutBeginLoadingMore(BGARefreshLayout refreshLayout) {
        return false;
    }
}
